package com.springboot.cms.footer.service.impl;


import com.springboot.cms.footer.domain.CmsFooter;
import com.springboot.cms.footer.mapper.CmsFooterMapper;
import com.springboot.cms.footer.service.ICmsFooterService;
import com.springboot.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 网站页脚Service业务层处理
 *
 * @author lhxz
 * @date 2024-07-06
 */
@Service
public class CmsFooterServiceImpl implements ICmsFooterService
{
    @Autowired
    private CmsFooterMapper cmsFooterMapper;

    /**
     * 查询网站页脚
     *
     * @param id 网站页脚主键
     * @return 网站页脚
     */
    @Override
    public CmsFooter selectCmsFooterById(Integer id)
    {
        return cmsFooterMapper.selectCmsFooterById(id);
    }

    /**
     * 查询网站页脚列表
     *
     * @param cmsFooter 网站页脚
     * @return 网站页脚
     */
    @Override
    public List<CmsFooter> selectCmsFooterList(CmsFooter cmsFooter)
    {
        return cmsFooterMapper.selectCmsFooterList(cmsFooter);
    }

    /**
     * 新增网站页脚
     *
     * @param cmsFooter 网站页脚
     * @return 结果
     */
    @Override
    public int insertCmsFooter(CmsFooter cmsFooter)
    {
        cmsFooter.setCreateTime(DateUtils.getNowDate());
        return cmsFooterMapper.insertCmsFooter(cmsFooter);
    }

    /**
     * 修改网站页脚
     *
     * @param cmsFooter 网站页脚
     * @return 结果
     */
    @Override
    public int updateCmsFooter(CmsFooter cmsFooter)
    {
        cmsFooter.setUpdateTime(DateUtils.getNowDate());
        return cmsFooterMapper.updateCmsFooter(cmsFooter);
    }

    /**
     * 批量删除网站页脚
     *
     * @param ids 需要删除的网站页脚主键
     * @return 结果
     */
    @Override
    public int deleteCmsFooterByIds(Integer[] ids)
    {
        return cmsFooterMapper.deleteCmsFooterByIds(ids);
    }

    /**
     * 删除网站页脚信息
     *
     * @param id 网站页脚主键
     * @return 结果
     */
    @Override
    public int deleteCmsFooterById(Integer id)
    {
        return cmsFooterMapper.deleteCmsFooterById(id);
    }
}
